<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>添加、编辑标签-后台管理-{$site.SITE_INFO.name}</title>
        <php>
            $addCss="";
            $addJs="";
            $currentNav ='资讯管理 > 添加编辑标签';
        </php>
        <include file="Common:intoHead" />
    </head>
    <body>
        <div class="wrap">
            <include file="Common:head" />
            <div class="mainBody">
                <include file="Common:left" />
                <div id="Right">
                    <div class="Item hr">
                        <div class="current">添加编辑标签</div>
                    </div>
                    <form>
                        <table width="100%" border="0" cellspacing="0" cellpadding="0" class="table1">
                            <tr>
                                <th>标签所属分类：</th>
                                <td>
                                    <select name="info[cid]">
                                        <volist name="list" id="vo">
                                            <if condition="$vo[cid] eq $info[cid]">
                                                <option value="{$vo.cid}" selected="selected">{$vo.fullname}</option>
                                                <else/>
                                                <option value="{$vo.cid}">{$vo.fullname}</option>
                                            </if>
                                        </volist>
                                    </select></td>
                            </tr>
                            <tr>
                                <th width="100">标签名称：</th>
                                <td><input id="name" type="text" class="input" size="60" name="info[name]" value="{$info.name}"/> <a href="javascript:void(0)" id="checkTagName">检测是否重复</a></td>
                            </tr>
                        </table>
                        <input type="hidden" name="info[id]" value="{$info.id}" />
                    </form>
                    <div class="commonBtnArea" >
                        <button class="btn submit">提交</button>
                    </div>
                </div>
            </div>
        </div>
        <div class="clear"></div>
        <include file="Common:foot" />
        <js href="__PUBLIC__/kindeditor/kindeditor.js,__PUBLIC__/kindeditor/lang/zh_CN.js"/>
        <script type="text/javascript">
            $(function(){
                $("#checkTagName").click(function(){
                    $.getJSON("__URL__/checkTagName/name/"+$("#name").val()+'/id/'+"{$info.id}", {}, function(json){
                        $("#checkTagName").css("color",json.status==1?"#0f0":"#f00").html(json.info);
                    });
                });
                $(".submit").click(function(){
                    commonAjaxSubmit();
                    return false;
                });
            });
        </script>
    </body>
</html>
